home *** CD-ROM | disk | FTP | other *** search
- on enterFrame
- set xCenter to ((the left of sprite 3 + the right of sprite 3) / 2) + 1
- set yCenter to ((the top of sprite 3 + the bottom of sprite 3) / 2) + 1
- set radius to (the width of sprite 3 / 2) - 2
- if value(field "Degrees") < 0 then
- set the foreColor of sprite 4 to 6
- else
- set the foreColor of sprite 4 to 3
- end if
- puppetSprite(4, 1)
- set the trails of sprite 4 to 1
- if field "Degrees" >= 0 then
- repeat with n = 0 to field "Degrees"
- set dy to float(radius) * float(sin((360 - n) * PI / 180.0))
- set dx to float(radius) * float(cos(n * PI / 180.0))
- if n > 360 then
- set the foreColor of sprite 4 to 235
- if value(field "Degrees") < 0 then
- set the foreColor of sprite 4 to 15
- end if
- end if
- drawLine(4, yCenter, xCenter, yCenter + dy, xCenter + dx)
- updateStage()
- end repeat
- else
- set n1 to -1 * field "Degrees"
- repeat with n = 0 to abs(n1)
- set dy to float(radius) * float(sin(n * PI / 180.0))
- set dx to float(radius) * float(cos(n * PI / 180.0))
- if n > 360 then
- set the foreColor of sprite 4 to 235
- if value(field "Degrees") < 0 then
- set the foreColor of sprite 4 to 15
- end if
- end if
- drawLine(4, yCenter, xCenter, yCenter + dy, xCenter + dx)
- updateStage()
- end repeat
- end if
- puppetSprite(4, 0)
- set the trails of sprite 4 to 0
- end
-